package com.seari.gena.task;

import java.util.Properties;

import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.seari.gena.ciosClient.CIOSUpdateClient;
import com.seari.utils.PropertiesUtil;

//import com.seari.gena.CIOSClient.CIOSUpdateClient;


public class CIOSupdateJob implements Job {
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		String jobName = context.getJobDetail().getKey().toString();
		System.out.println(jobName + "定时任务开启..");
		JobDetail detail = context.getJobDetail();
		String sid = detail.getJobDataMap().getString("data1");
		try {
			Properties prop = PropertiesUtil.loadConfig("gena.properties");
			new CIOSUpdateClient(prop.getProperty("ATSServerIp1"), Integer.parseInt(prop.getProperty("ATSServerPort")),sid).setup();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(jobName + "定时任务结束..");

	}

}
